from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application
from app.urls import urls
from app.settings import settings
import os
class CustomApplication(Application):
    def __init__(self):
        # 调用父类的伨
        super(CustomApplication,self).__init__(urls,**settings)

def create_server():
    server = HTTPServer(CustomApplication())
    # 监听8800端口
    server.listen(8800)
    print('127.0.0.1:8800')
    # 启动服务器
    IOLoop.current().start()
if __name__ == '__main__':
    # 启动
    create_server()
